<template>
	<van-swipe :autoplay="3000" indicator-color="#fff">
		<van-swipe-item v-for="(image, index) in images" :key="index" @click="topage(image.url)">
			<img v-lazy="$base_serve+image.image" />
		</van-swipe-item>
	</van-swipe>
</template>

<script>
	import banner from "@/assets/img/juxing.png"
	export default {
		name: "Banner",
		data() {
			return {
				images: [],
			}
		},
		
		mounted() {
			let bannerdata = {
				category_id: 14,
				site_id:this.$localStorage.get("site_id")||0
			}
			this.$api.home.bannerAds(bannerdata).then(res => {
				// 执行某些操作
				if (res.code == 1) {
					this.images = res.data
				}

			})
		},
		methods:{
			
			topage(url){
				window.location.href = url
			}
		}


	}
</script>

<style scoped lang="less">
	img {
		width: 100%;
	}
</style>
